#include<bits/stdc++.h>
#define all(a) a.begin(), a.end()
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
using vi  = std::vector<i32>;
using pii = std::pair<i32, i32>;
using vii = std::vector<pii>;
using vl  = std::vector<i64>;
using pll = std::pair<i64, i64>;
using vll = std::vector<pll>;

//std::mt19937 rng {std::chrono::steady_clock::now().time_since_epoch().count()};

template<class T = int>
std::vector<T> getv(int n, int start = 0) {
	std::vector<T> res(n + start);
	for(int i = 0; i < n + start; i++) {
		std::cin >> res[i];
	}
	return res;
}


int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);

	int h, w, q;
	std::cin >> h >> w >> q;
	std::vector<std::set<int>> r(h), c(w);
	for(int i = 0; i < h; i++) {
		for(int j = 0; j < w; j++) {
			r[i].insert(j);
			c[j].insert(i);
		}
	}

	int ans = h * w;
	while(q--) {
		int x, y;
		std::cin >> x >> y;
		x--;
		y--;

		if(r[x].contains(y)) {
			ans--;
			r[x].erase(y);
			c[y].erase(x);
		} else {
			auto it = r[x].lower_bound(y);
			if(it != r[x].begin()) {
				int b = *std::prev(it);
				ans--;
				r[x].erase(b);
				c[b].erase(x);
			}
			if (it != r[x].end()) {
                int b = *it;
                ans--;
                r[x].erase(b);
                c[b].erase(x);
            }
            it = c[y].lower_bound(x);
            if (it != c[y].begin()) {
                int a = *std::prev(it);
                ans--;
                r[a].erase(y);
                c[y].erase(a);
            }
            if (it != c[y].end()) {
                int a = *it;
                ans--;
                r[a].erase(y);
                c[y].erase(a);
            }
		}
	}
	std::cout << ans;
	
	return 0;
}